<div ng-if="pagedata.account.myfromuser<=0" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:url('{{siteroot}}../core/resource/images/login-bg-sm.jpg') no-repeat 100%;background-size: 100%;">
		<div class="top" style="margin-top:-1.5rem;z-index:108">
			<div class="c">
				<img style="width:3rem;height:3rem;border-radius:100%" src="{{tomedia(pagedata.account.logo) || '../core/resource/images/web-logo.jpg'}}"  />
			</div>
		</div>
		<div class="fui-line-title" style="padding-top:0">
			<div>{{pagedata.account.title}}</div>
		</div>
		<div style="background:none;height:auto;width:auto;padding:1rem 0.5rem;margin-bottom:1rem">
			<div style="padding:0.5rem">
				<div class="fui-code" style="background: none;border-radius: 0.5rem;padding-bottom:1rem">
				<div class="fui-cell-group radius" style="background:none">
					<div class="fui-cell must">
						<div class="fui-cell-label">邀请码</div>
						<div class="fui-cell-text">
						<input type="text" class='fui-input' placeholder="请输入邀请码"  ng-model="pagedata.postto.fromuser" ng-blur="pagedata.showmember()"/>
						<div ng-if="pagedata.tomember.id" class='fui-cellone radius' style="margin-left:0.3rem;margin-right:0.5rem;padding:0.2rem;background-color:rgba(0,0,0,0.3)">
							<div class='fui-cell-label' style='width:auto;color:#fff'><img ng-src="{{tomedia(pagedata.tomember.avatar) ||'../core/resource/images/nopic.jpg'}}" class="round" style="width:1.2rem;height:1.2rem;border-radius:100%"></div>
							<div class='fui-cell-text' style="font-size:0.45rem">
								<div class="text">{{pagedata.tomember.nickname||pagedata.tomember.username}}</div>
								<div class="text">MID:{{pagedata.tomember.id}}</div>
							</div>
						</div>
						</div>
					</div>
				</div>
				<div class="fui-line-title" style="padding-top:0;font-size:0.6rem">
					<div class="gray">输入正确的邀请码，才能正常使用本平台！</div>
				</div>
				</div>
				<button class="weui_btn weui_btn_primary sysbgcolor" style="margin: auto;margin-top:1.5rem;width:80%;" href='javascript:;' ng-click="pagedata.upfromuser()">确认提交</button>
			</div>		
		</div>
		</div>
	</div>
	<script>
	scope.pagedata.postto=scope.pagedata.postto?scope.pagedata.postto:{}
	scope.pagedata.upfromuser=function(){
		scope.post_json('core/member.register/upfromuser/',scope.pagedata.postto,function(res){
			if(res!='success'){
				scope.message(res);
				return false;
			}
			scope.message('操作成功！');
			scope.pagedata.account.myfromuser=scope.pagedata.postto.fromuser;
			scope.$evalAsync();
		});
	}
	scope.pagedata.showmember=function(){
		if(!scope.pagedata.postto.fromuser){
			return '';
		}
		scope.get('core/member.register/getmember/fromcode='+scope.pagedata.postto.fromuser,function(res){
			if(res.tomember && res.tomember.id){
				scope.pagedata.tomember=res.tomember;
			}else{
				scope.message(res,'error');
			}
		});
	}
	</script>
</div>